const LiiPlugin = require("./plugins/lii-plugin");
const path = require("path");
module.exports = (env, argv) => {
  const extra_config={}
  if (argv.mode === 'development') {
    extra_config.devtool = 'source-map';
  }
  if (argv.mode === 'production') {
    //...
  }
  return {
    mode: env.mode,
    entry: {
        main:"./src/index.js",
        home:"./src/home/index.js",
        page:"./src/page/index.js",
    },
    output: {
      path: path.resolve(__dirname, "dist"),
      filename: "bundle.js",
      clean: true,
    },
    plugins: [new LiiPlugin({ msg: "Custom Plugin Message" })],
    module: {
      rules: [
        {
          test: /\.lii$/,
          use: {
            loader: path.resolve(__dirname, "loaders/lii-loader.js"),
            options: {
              prefix: "/* Custom Loader Output */\n",
            },
          },
        },
      ],
    },
    ...extra_config
  };
};
